<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* --单独使用都会自减 */
         var a = 10;
         a--; //a=a-1;
        console.log(a)  // a=9

        /* --放前面，先自减，后运算
           --放后面，先运算，后自减 */
           var a = 10;
           b = a--; // b=10; a=9;
           console.log(a) // a=9
           console.log(b) // b=10

           var a =20;
           b = --a +1; // a=19 b=20
           console.log(a) // a=19
           console.log(b) // b=20

    </script>
</body>
</html>